babl.git
7 years agotests: add format_with_space test
Øyvind Kolås [Thu, 21 Jun 2018 12:49:12 +0000 (14:49 +0200)]
tests: add format_with_space test

Testing that both R'G'B' formats and CIE Lab float keep the space they have
been created with.

7 years agobabl: refactor format registration to loop over types
Øyvind Kolås [Wed, 20 Jun 2018 19:04:46 +0000 (21:04 +0200)]
babl: refactor format registration to loop over types

Also register full set of R~G~B~ and Y~ formats for all the types.

7 years agobabl: add ~ variants to gray color models
Øyvind Kolås [Wed, 20 Jun 2018 18:43:53 +0000 (20:43 +0200)]
babl: add ~ variants to gray color models

We do not add premultiplied sRGB trc variants even if this exists for RGB
since it is the type of premultiplied alpha cairo expects. The less code
that does non-linear compositing the better, excluding some possibilities
also reduces the combinatorial overhead of finding conversion paths in babl.

7 years agobabl: add R~G~B~ color models and pixel formats
Øyvind Kolås [Wed, 20 Jun 2018 10:33:28 +0000 (12:33 +0200)]
babl: add R~G~B~ color models and pixel formats

From a given BablSpace which defines RGB chromaticities and
per component TRCs, the following are the defined formats:

R'G'B' with the TRCs applied
RGB    linear data

and now a new one

R~G~B~ with the sRGB TRC, this permits any BablSpace to be the
native format of a buffer in an application while having both
a 'perceptual' in R~G~B~ and linear in RGB that is possible
to derive from it. Importantly it is also possible to recover
the babl space used to create the buffer.

7 years agobabl: clarify internal gray babl-id enums
Øyvind Kolås [Wed, 20 Jun 2018 17:35:43 +0000 (19:35 +0200)]
babl: clarify internal gray babl-id enums

Use GRAY_LINEAR and GRAY_NONLINEAR making the introduction of PERCEPTUAL
easier.

7 years agobabl: remove outdated comment
Øyvind Kolås [Wed, 20 Jun 2018 10:55:55 +0000 (12:55 +0200)]
babl: remove outdated comment

7 years agobabl: rename functions that used to refer to specific gamma
Øyvind Kolås [Tue, 19 Jun 2018 17:29:48 +0000 (19:29 +0200)]
babl: rename functions that used to refer to specific gamma

The definitions of components and formats for linear and nonlinear formats in
model-rgb and model-gray are now using the TRC of a BablSpace, thus in the
format syntax ' now means nonlinear, not sRGB / 2.2 gamma - even though it ends
up meaning that for formats create without specifying the space.

7 years agobabl-palette: warn when trying to create a palette with > 256 colors
Ell [Thu, 14 Jun 2018 06:16:08 +0000 (02:16 -0400)]
babl-palette: warn when trying to create a palette with > 256 colors

... and only use the first 256 colors.

7 years agobabl-fish: fix concurrent babl_fish()/process() calls with palette formats
Ell [Thu, 14 Jun 2018 05:54:52 +0000 (01:54 -0400)]
babl-fish: fix concurrent babl_fish()/process() calls with palette formats

In babl_fish(), don't call _babl_fish_rig_dispatch() on existing
path fishes during each lookup.  We already call this function on
all path fishes upon creation (in particular, after commit
b34a9672c8c9a42923a8f0b2650af30b1efe635c), so this isn't necessary.

This fixes an issue where the _babl_fish_rig_dispatch() call in
babl_fish() would temporarily modify the value of babl->fish.data,
causing a concurrent babl_process[_rows]() call in another thread
to pass the wrong 'data' value down to the conversion function.  In
particular, this could cause palette conversions to segfault.

7 years agobabl: fix fixed to double conversions
Elle Stone [Sat, 9 Jun 2018 17:18:43 +0000 (19:18 +0200)]
babl: fix fixed to double conversions

See issue #18 https://gitlab.gnome.org/GNOME/babl/issues/18

7 years agobabl-space: babl_space_new_from_chromaticities add equalize_matrix argument
Øyvind Kolås [Sat, 9 Jun 2018 17:11:26 +0000 (19:11 +0200)]
babl-space: babl_space_new_from_chromaticities add equalize_matrix argument

Part of the problem in issue #18

This API is internal only for now so we can change it, changing to use a
hard-coded pre-quantized chromaticities set for the internal sRGB space.

This preserve the gray axis matrix equalization performed for other spaces used
with babl, ideally we can improve the gray-axis equalization to match and
return to using it also for sRGB.

7 years agobabl-palette: warn when trying to create a 0-color palette
Ell [Wed, 30 May 2018 10:01:27 +0000 (06:01 -0400)]
babl-palette: warn when trying to create a 0-color palette

In babl_palette_set_palette(), fall back to the default palette,
and log a warning, when trying to create a palette with < 1 colors.

7 years agobabl-memory: allow babl_malloc(0) to succeed
Ell [Wed, 30 May 2018 09:45:17 +0000 (05:45 -0400)]
babl-memory: allow babl_malloc(0) to succeed

Allow a babl_malloc() call with size == 0 to succeed, returning a
dummy allocation, instead of asserting on this condition.  The new
babl-palette code tries to allocate an empty buffer for the radii
array when creating a single-color palette, which would previously
lead to a crash.

7 years agobabl-palette: fix default-palette radii array size
Ell [Fri, 25 May 2018 12:52:47 +0000 (08:52 -0400)]
babl-palette: fix default-palette radii array size

7 years agobabl-palette: make default palette initialization thread-safe
Ell [Thu, 24 May 2018 14:55:17 +0000 (10:55 -0400)]
babl-palette: make default palette initialization thread-safe

... and allocate its radii statically.

7 years agopost release version bump
Øyvind Kolås [Sun, 20 May 2018 08:49:52 +0000 (10:49 +0200)]
post release version bump

7 years agorelease 0.1.50
Øyvind Kolås [Sun, 20 May 2018 08:45:46 +0000 (10:45 +0200)]
release 0.1.50

7 years agoFix an unimportant typo
Edward E [Sun, 1 Apr 2018 06:23:45 +0000 (01:23 -0500)]
Fix an unimportant typo

What's in a name? S.E.P.

7 years agotests: fix palette-concurrency-stress-test
Ell [Sat, 19 May 2018 12:28:19 +0000 (08:28 -0400)]
tests: fix palette-concurrency-stress-test

Fix palette-concurrency-stress-test to accommodate the change to a
gamma-corrected 8-bit format (commit
fabcc6729ed453fb5c5affc565d0e837a78afc5c), and to little-endian
hash indices (commit 55ca45c8233af138d3fd388587b203d802b8396c).

The test should pass regardless, it simply didn't actually test for
the intended issue previously.

7 years agotools: code around gcc warning about 0 length format string
Øyvind Kolås [Sat, 19 May 2018 11:35:04 +0000 (13:35 +0200)]
tools: code around gcc warning about 0 length format string

7 years agoMeson build: fixes for windows build
John Marshall [Sat, 19 May 2018 11:08:12 +0000 (12:08 +0100)]
Meson build: fixes for windows build

7 years agoMeson build: generate png image files for docs
John Marshall [Sat, 19 May 2018 10:53:51 +0000 (11:53 +0100)]
Meson build: generate png image files for docs

7 years agoMeson build: Improve git-version.h generation
John Marshall [Sat, 19 May 2018 10:51:30 +0000 (11:51 +0100)]
Meson build: Improve git-version.h generation

7 years agoMeson build: Tidy up code and improve readability
John Marshall [Sat, 19 May 2018 10:48:26 +0000 (11:48 +0100)]
Meson build: Tidy up code and improve readability

7 years agoMeson build: improve doc generation
John Marshall [Sat, 19 May 2018 10:38:18 +0000 (11:38 +0100)]
Meson build: improve doc generation

7 years agoMeson build: Improve host environment detection / handling
John Marshall [Sat, 19 May 2018 10:36:45 +0000 (11:36 +0100)]
Meson build: Improve host environment detection / handling

7 years agoMeson build: Improve SIMD assembly checking/use
John Marshall [Sat, 19 May 2018 10:01:46 +0000 (11:01 +0100)]
Meson build: Improve SIMD assembly checking/use

7 years agobabl-palette: initialize radii of default palette
Ell [Fri, 18 May 2018 13:01:26 +0000 (09:01 -0400)]
babl-palette: initialize radii of default palette

... to prevent a segfault when using the default palette, namely,
in tests/palette.

7 years agobabl-palette: speed up closest-color search
Ell [Fri, 18 May 2018 12:04:52 +0000 (08:04 -0400)]
babl-palette: speed up closest-color search

When constructing a palette format, calculate the distance between
each pair of colors in the palette, and for each color, construct a
list of all other colors and their distances from it, sorted by
distance.  When searching for the closest palette color to a given
input pixel, based on the assumption that nearby pixels have
similar color, use the color list of the previous pixel's best
match, and use the triangle inequality to stop the search early.

See the code comments for more details.

7 years agobabl: use hashtable approach in double reference
Øyvind Kolås [Fri, 18 May 2018 09:02:04 +0000 (11:02 +0200)]
babl: use hashtable approach in double reference

Strictly speaking we should be doing the reference using
conversions to R'G'B'A double and using the distance metric
there; possibly getting a slight difference in result at
comparison ties.

In use GEGL ends up using both the really fast 8bit code paths
and the quite fast floating point code paths that use 8bit
hashtables for the lookup of conversion.

Progress on bug #787237 missing fast-paths.

7 years agobabl-palette: fix regression in prefvious commit
Øyvind Kolås [Thu, 17 May 2018 14:24:49 +0000 (16:24 +0200)]
babl-palette: fix regression in prefvious commit

The 255.5 factor for storing a double represenation is neccesary for
desired behavior.

7 years agobabl-palette: improvements toward palette accuracy
Øyvind Kolås [Thu, 17 May 2018 12:33:07 +0000 (14:33 +0200)]
babl-palette: improvements toward palette accuracy

For working at acceptable performance with large indexed images, it is
recommended to run with BABL_TOLERANCE=0.0385 or highger set in the environment
when launching GIMP, this permits using a hashtable based optimization that
still isn't accurate enough according to babl-expectations.

Part of progress on bug 787237

7 years agomeson.build: synchronise with autotools version
Øyvind Kolås [Thu, 17 May 2018 10:53:42 +0000 (12:53 +0200)]
meson.build: synchronise with autotools version

WARNING: distributions should still not use meson to build packages - since
the meson build end up containing all instructions available on build host.

7 years agomeson.build: Bump version to 0.1.48
Jan Vesely [Thu, 17 May 2018 04:04:04 +0000 (00:04 -0400)]
meson.build: Bump version to 0.1.48

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
7 years agobabl: preliminary work to add float fast path to palette formats
Øyvind Kolås [Wed, 16 May 2018 11:13:26 +0000 (13:13 +0200)]
babl: preliminary work to add float fast path to palette formats

Still not accurate enough to be acceptable, gets accepted by system with
a BABL_TOLERANCe of 0.045 or higher. Needs more work.

7 years agopost release version bump
Øyvind Kolås [Tue, 15 May 2018 19:29:56 +0000 (21:29 +0200)]
post release version bump

7 years agorelease 0.1.48
Øyvind Kolås [Tue, 15 May 2018 19:28:11 +0000 (21:28 +0200)]
release 0.1.48

7 years agoconfigure: try to add -Ofast to CFLAGS
Øyvind Kolås [Tue, 15 May 2018 19:06:16 +0000 (21:06 +0200)]
configure: try to add -Ofast to CFLAGS

7 years agoCIE: Style fix
Debarshi Ray [Mon, 14 May 2018 14:04:27 +0000 (16:04 +0200)]
CIE: Style fix

Fallout from 3788e861e545d43d5911677250c0f55d5f7ccedf

7 years agoCIE: Add an SSE2 version of "RGBA float" to "CIE L float"
Debarshi Ray [Mon, 14 May 2018 09:24:27 +0000 (11:24 +0200)]
CIE: Add an SSE2 version of "RGBA float" to "CIE L float"

On an Intel i7 Haswell, it now takes 0.056s to convert a 15 megapixel
buffer from "RGBA float" to "CIE L float" instead of the earlier
0.107s.

https://bugzilla.gnome.org/show_bug.cgi?id=795686

7 years agoCIE: Add an SSE2 version of "RGBA float" to "CIE Lab alpha float"
Debarshi Ray [Sat, 28 Apr 2018 23:15:46 +0000 (01:15 +0200)]
CIE: Add an SSE2 version of "RGBA float" to "CIE Lab alpha float"

On an Intel i7 Haswell, it now takes 0.13s to convert a 15 megapixel
buffer from "RGBA float" to "CIE Lab alpha float" instead of the
earlier 0.27s.

SSEx doesn't have integer multiplication or division operations, and
using bit shifts to implement integer divisions by powers of 2 seems to
introduce errors. Therefore, it was problematic to use the cube root
approximation from Hacker's Delight, which uses quite a few integer
divisions to make the initial guess. Instead, Halley's method of
approximating the cube root seems more SSEx friendly because the
initial guess requires only one integer division, which we can manage
by jumping through a relatively small number of hoops.

The scalar version of Halley's method seems to have originated from
http://metamerist.com/cbrt/cbrt.htm but that's not accessible anymore.
At present there's a copy in CubeRoot.cpp in the Skia sources that's
licensed under a BSD-style license. There's some discussion on the
implementation at http://www.voidcn.com/article/p-gpwztojr-wt.html.

Note that Darktable also has an SSE2 version of the same algorithm,
but uses only a single iteration of Halley's method, which is too
coarse.

Here's some more discussion on the cube root approximation algorithms:
https://bugzilla.gnome.org/show_bug.cgi?id=791837

https://bugzilla.gnome.org/show_bug.cgi?id=795686

7 years agobuild: Add scaffolding for SSE3
Debarshi Ray [Sun, 29 Apr 2018 21:57:42 +0000 (23:57 +0200)]
build: Add scaffolding for SSE3

It's currently unused, but is useful to have it around when comparing
different vectorization strategies.

https://bugzilla.gnome.org/show_bug.cgi?id=795686

7 years agoCIE: Make the XYZ to LAB code look similar to the RGB to LAB code
Debarshi Ray [Sat, 28 Apr 2018 22:21:44 +0000 (00:21 +0200)]
CIE: Make the XYZ to LAB code look similar to the RGB to LAB code

Such superficial differences make the code harder to scan when looking
for bugs and optimization opportunities.

7 years agobabl-internal: print debug output to stderr
Øyvind Kolås [Wed, 25 Apr 2018 18:22:38 +0000 (20:22 +0200)]
babl-internal: print debug output to stderr

7 years agoextensions/two-table: remove unused variable
Øyvind Kolås [Tue, 24 Apr 2018 18:15:03 +0000 (20:15 +0200)]
extensions/two-table: remove unused variable

7 years agotype-u8: fix u8 <> double conversions for chroma type
Thomas Manni [Sun, 4 Mar 2018 09:17:07 +0000 (10:17 +0100)]
type-u8: fix u8 <> double conversions for chroma type

7 years agopostrelease version bump
Øyvind Kolås [Tue, 10 Apr 2018 21:17:04 +0000 (23:17 +0200)]
postrelease version bump

7 years agorelease 0.1.46
Øyvind Kolås [Tue, 10 Apr 2018 21:15:57 +0000 (23:15 +0200)]
release 0.1.46

7 years agoNEWS: update
Øyvind Kolås [Tue, 10 Apr 2018 21:08:58 +0000 (23:08 +0200)]
NEWS: update

7 years agotools: add html variant of path matrix
Øyvind Kolås [Sun, 8 Apr 2018 11:05:10 +0000 (13:05 +0200)]
tools: add html variant of path matrix

7 years agodocs: remove short-cut coverage, which is too expensive to generate
Øyvind Kolås [Sat, 7 Apr 2018 22:48:44 +0000 (00:48 +0200)]
docs: remove short-cut coverage, which is too expensive to generate

7 years agoextensions: remove many inline statements
Øyvind Kolås [Sat, 7 Apr 2018 16:22:07 +0000 (18:22 +0200)]
extensions: remove many inline statements

When the functions are not reused by other fast path definitions, they are only
ever used as function pointers and inline is not neccesary.

7 years agoextensions/double: adds some more paths
Øyvind Kolås [Sat, 7 Apr 2018 15:52:02 +0000 (17:52 +0200)]
extensions/double: adds some more paths

7 years agoextensions: rename some extensions
Øyvind Kolås [Sat, 7 Apr 2018 12:19:46 +0000 (14:19 +0200)]
extensions: rename some extensions

7 years agoextensions: add more u32 short cut utility conversions
Øyvind Kolås [Sat, 7 Apr 2018 15:04:56 +0000 (17:04 +0200)]
extensions: add more u32 short cut utility conversions

7 years agoextensions: u32<->float conversions in simple extension
Øyvind Kolås [Sat, 7 Apr 2018 15:01:08 +0000 (17:01 +0200)]
extensions: u32<->float conversions in simple extension

They were using 'float' rather than 'double' data types for intermediate values
the lack of precision made the conversions be discarded by babl.

7 years agoextensions: add missing 32bit.c
Øyvind Kolås [Fri, 6 Apr 2018 11:14:34 +0000 (13:14 +0200)]
extensions: add missing 32bit.c

7 years agoextensions: add some u32 fast paths
Øyvind Kolås [Fri, 6 Apr 2018 10:40:46 +0000 (12:40 +0200)]
extensions: add some u32 fast paths

7 years agofloat-half: half fast paths for premultiplied alpha
Øyvind Kolås [Thu, 5 Apr 2018 22:53:16 +0000 (00:53 +0200)]
float-half: half fast paths for premultiplied alpha

7 years agoextensions: add a double extension
Øyvind Kolås [Thu, 5 Apr 2018 21:24:31 +0000 (23:24 +0200)]
extensions: add a double extension

This will permit slightly faster than the generic fast paths for some possibly
desired intermediate conversions. This also adds alpha stripping - which fills
in the last babl fast path currently reported missing on every launch of GIMP.

7 years agoextensions: simplify gggl/conv_rgbF_rgbaF slightly
Øyvind Kolås [Wed, 4 Apr 2018 22:39:23 +0000 (00:39 +0200)]
extensions: simplify gggl/conv_rgbF_rgbaF slightly

7 years agoextensions/cairo: optimize R'G'B'A u8 to cairo-ARGB32
Øyvind Kolås [Wed, 4 Apr 2018 22:15:08 +0000 (00:15 +0200)]
extensions/cairo: optimize R'G'B'A u8 to cairo-ARGB32

A combination of SIMD paths via float was beating the naive implementation in
the cairo extension, now the cairo extension comes out on top again.

7 years agoextension: add some Y' u8 fast paths
Øyvind Kolås [Wed, 4 Apr 2018 21:49:55 +0000 (23:49 +0200)]
extension: add some Y' u8 fast paths

GIMP makes use of "Y' u8" to "R'G'B' u8" and we had no paths covering it,
making it go through floating point. This commit adds code paths for expanding
single grayscale u8 to R'G'B and R'G'B'A as well as R'aG'aB'aA u8.

7 years agoextensions/gegl-fixups: swap increments of src and dst in rgba8_rgb8
Øyvind Kolås [Wed, 4 Apr 2018 14:41:51 +0000 (16:41 +0200)]
extensions/gegl-fixups: swap increments of src and dst in rgba8_rgb8

They were reversed, causing memory corruptions fixing bugs 794973 and 794972.

7 years agoextensions: add rgba8_rgb8 conversion that copies 24/32bit chunks
Øyvind Kolås [Wed, 4 Apr 2018 12:09:54 +0000 (14:09 +0200)]
extensions: add rgba8_rgb8 conversion that copies 24/32bit chunks

Slightly speeding up RGB u8 (without alpha) painting in GIMP, the rgba to rgb
and reverse conversions are used together with the very fast SIMD conversions
that operate on chunks of 4 components.

8 years agopost release version bump
Øyvind Kolås [Sun, 18 Feb 2018 11:29:35 +0000 (12:29 +0100)]
post release version bump

8 years agorelease 0.1.44
Øyvind Kolås [Sun, 18 Feb 2018 11:27:46 +0000 (12:27 +0100)]
release 0.1.44

8 years agobabl: fix minor leak reported in bug #790924
Øyvind Kolås [Wed, 7 Feb 2018 18:53:48 +0000 (19:53 +0100)]
babl: fix minor leak reported in bug #790924

8 years agoAdded mingw template pkgbuild.
Félix Piédallu [Mon, 29 Jan 2018 12:48:26 +0000 (13:48 +0100)]
Added mingw template pkgbuild.

8 years agoFix windows dirs_sep. Cleanup.
Félix Piédallu [Thu, 11 Jan 2018 20:32:57 +0000 (21:32 +0100)]
Fix windows dirs_sep. Cleanup.

8 years agoRemove check for linux header on win32
Félix Piédallu [Thu, 11 Jan 2018 20:26:34 +0000 (21:26 +0100)]
Remove check for linux header on win32

8 years agoRemove os_win32
Félix Piédallu [Thu, 11 Jan 2018 20:25:50 +0000 (21:25 +0100)]
Remove os_win32

8 years agoTemporarily disable checking for headers
Félix Piédallu [Tue, 9 Jan 2018 20:48:01 +0000 (21:48 +0100)]
Temporarily disable checking for headers

8 years agoPKGBUILD points again to gnome upstream
Félix Piédallu [Mon, 18 Dec 2017 14:14:29 +0000 (15:14 +0100)]
PKGBUILD points again to gnome upstream

8 years agoFix : libdir for autotools and meson are not the same…
Félix Piédallu [Mon, 18 Dec 2017 14:06:57 +0000 (15:06 +0100)]
Fix : libdir for autotools and meson are not the same…

8 years agobabl: fix icc matrix profile fast paths
Øyvind Kolås [Tue, 30 Jan 2018 15:35:28 +0000 (16:35 +0100)]
babl: fix icc matrix profile fast paths

For core members, babl relies on shared data layout between fish and
conversion to be able to do dispatch, and have source/target match -
though only for simple fishes.

The ICC fast path conversions also used the user data - but directly
instead of throug the argument, changing this makes the matrix and
luts work again - and let the conversions be used.

8 years agomeson: Add missing single quote
Jan Vesely [Wed, 24 Jan 2018 23:51:58 +0000 (18:51 -0500)]
meson: Add missing single quote

Fixes build since ad0eac19c7a1f0046979ad8923f6ac1b7c2d7696 ("release 0.1.42")

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
8 years agopost release version bump
Øyvind Kolås [Tue, 23 Jan 2018 15:36:04 +0000 (16:36 +0100)]
post release version bump

8 years agorelease 0.1.42
Øyvind Kolås [Tue, 23 Jan 2018 15:09:34 +0000 (16:09 +0100)]
release 0.1.42

8 years agobabl: initialize the bpp of fishes loaded from cache
Øyvind Kolås [Sat, 20 Jan 2018 17:41:12 +0000 (18:41 +0100)]
babl: initialize the bpp of fishes loaded from cache

The cache loading code manually constructs path fishes, which did not
get their bpp initialized, this resulted in conversions of long runs to
fail, not crash - but stop processing after MAX_BUFFER_SIZE pixels.

8 years agopost release version bump
Øyvind Kolås [Wed, 17 Jan 2018 03:07:30 +0000 (04:07 +0100)]
post release version bump

8 years agoNEWS: update
Øyvind Kolås [Tue, 16 Jan 2018 17:48:35 +0000 (18:48 +0100)]
NEWS: update

8 years agorelease 0.1.40
Øyvind Kolås [Tue, 16 Jan 2018 17:38:49 +0000 (18:38 +0100)]
release 0.1.40

8 years agobabl: add a test iteration multiplier
Øyvind Kolås [Wed, 17 Jan 2018 02:57:23 +0000 (03:57 +0100)]
babl: add a test iteration multiplier

On my system many of the conversions got measured to costs of 3 4 and 5, these
makes a big room for measurement errors, to increase reliability the tests are
now run 4 times - making it a ranking of contenders with fewer collisions.

This will slightly increase incurred delayed on search for conversions.

8 years agobabl: make pixel-count instrumentation opt-in
Øyvind Kolås [Wed, 17 Jan 2018 02:46:59 +0000 (03:46 +0100)]
babl: make pixel-count instrumentation opt-in

Checking if an integer is 0/1 is lower overhead than incrementing a long stored
kt a memory location. As a side effect, the entries in
~/.cache/babl/babl-fishes will not be sorted by most used to least used unless
the BABL_INSTRUMENT environment variable is set to a value.

8 years agobabl: set user_data ptr for quick dispatch of 1 step path
Øyvind Kolås [Tue, 16 Jan 2018 17:34:46 +0000 (18:34 +0100)]
babl: set user_data ptr for quick dispatch of 1 step path

8 years agobabl: indentation and code cleanup
Øyvind Kolås [Tue, 16 Jan 2018 17:12:47 +0000 (18:12 +0100)]
babl: indentation and code cleanup

8 years agobabl: use memcpy dpsatch path for all identity transforms
Øyvind Kolås [Mon, 15 Jan 2018 21:41:03 +0000 (22:41 +0100)]
babl: use memcpy dpsatch path for all identity transforms

8 years agobabl: reduce amount of instrumentation
Øyvind Kolås [Mon, 15 Jan 2018 13:21:59 +0000 (14:21 +0100)]
babl: reduce amount of instrumentation

The integer counter for number of processings overflows in some scenarios, thus
cannot be relied on for more than being informative.

We might ultimately want to also drop the instrumentation.

8 years agobabl: store pointer to where user data resides instead of copy
Øyvind Kolås [Sun, 14 Jan 2018 22:55:53 +0000 (23:55 +0100)]
babl: store pointer to where user data resides instead of copy

This will make the scenario of changing user data work, we do it
unconditionally to avoid introducing a branch.

8 years agobabl: refactor code to get rid of more branches in babl_process
Øyvind Kolås [Sun, 14 Jan 2018 21:49:40 +0000 (22:49 +0100)]
babl: refactor code to get rid of more branches in babl_process

In the best case scenario now, babl_process increments instrumentation
counters and directly calls the relevant registered fast path function,
with no additional call stack frames in-between.

8 years agobabl: use babl_conversion_process where appropriate
Øyvind Kolås [Sun, 14 Jan 2018 21:15:12 +0000 (22:15 +0100)]
babl: use babl_conversion_process where appropriate

Instead of overloading babl_process() with two tasks, both fishes and
conversions, use the conversion specific API for conversions directly.

8 years agobabl: simplify branching in babl_process dispatch
Øyvind Kolås [Sun, 14 Jan 2018 20:44:18 +0000 (21:44 +0100)]
babl: simplify branching in babl_process dispatch

8 years agobabl: factor out some branches from path fish dispatch
Øyvind Kolås [Sun, 14 Jan 2018 18:19:30 +0000 (19:19 +0100)]
babl: factor out some branches from path fish dispatch

8 years agobabl: refactor conversion dispatch to do less branches at runtime
Øyvind Kolås [Sun, 14 Jan 2018 17:36:26 +0000 (18:36 +0100)]
babl: refactor conversion dispatch to do less branches at runtime

8 years agobabl.map: update symbols for meson build
Øyvind Kolås [Sat, 13 Jan 2018 14:43:01 +0000 (15:43 +0100)]
babl.map: update symbols for meson build

8 years agobabl: add babl_process_rows api
Øyvind Kolås [Sun, 7 Jan 2018 00:10:54 +0000 (01:10 +0100)]
babl: add babl_process_rows api

Useful when fetching buffers smaller than a tile or partial tiles in APIs like
gegl_buffer_get.

8 years agosse2-float: use same TRC for "leftover" samples
Ell [Sat, 13 Jan 2018 09:02:24 +0000 (04:02 -0500)]
sse2-float: use same TRC for "leftover" samples

The SSE2 versions of the gamma <-> linear TRC functions can produce
slightly different results than the scalar ones.  Consequently,
last commit didn't resolve all discrepancies between the main and
leftover samples (and didn't address the gamma -> linear
direction).

Use the same SSE2 TRC functions for converting the leftover
samples, rather than the scalar functions, to fix that.

8 years agosse2-float: use babl_linear_to_gamma_2_2f() (instead of double)
Ell [Thu, 11 Jan 2018 14:22:46 +0000 (09:22 -0500)]
sse2-float: use babl_linear_to_gamma_2_2f() (instead of double)

Use the single-precision babl_linear_to_gamma_2_2f() function,
instead of the double-precision version, when converting "leftover"
samples, so that the result is consistent with the vectorized
samples.

8 years agoutil, sse2-float: make sure 1 maps to 1 in linear -> gamma conversions
Ell [Thu, 11 Jan 2018 14:19:50 +0000 (09:19 -0500)]
util, sse2-float: make sure 1 maps to 1 in linear -> gamma conversions

Add a small offset to the result of the linear -> gamma
conversions, such that an input value of 1.0 maps to an output
value of 1.0, exactly.